<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('申请开店列表')"/>
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="case-form">
                <div class="select-list">
                    <ul>
                        <li>
                            审核状态：<select name="reviewStatus" th:with="type=${@dict.getType('shop_review_status')}">
                            <option value="">全部</option>
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                                    th:value="${dict.dictValue}"></option>
                        </select>
                        </li>
                        <li>
                            店铺名称：<input type="text" name="shopName"/>
                        </li>
                        <li>
                            申请人名称：<input type="text" name="applicantName"/>
                        </li>
                        <li>
                            申请人手机：<input type="text" name="applicantPhone"/>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                    class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                    class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('back:shopApply:edit')}]];
    const reviewStatusDict = [[${@dict.getType('shop_review_status')}]]
    var prefix = ctx + "back/shop";

    $(function () {
        var options = {
            url: prefix + "/searchList",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            modalName: "申请开店",
            sortName: "createTime",
            sortOrder: "desc",
            columns: [
                {
                    field: 'id',
                    title: '店铺编号',
                    sortable:true
                },
                {
                    field: 'shopName',
                    title: '店铺名称'
                },
                {
                    field: 'shopCode',
                    title: '店铺昵称'
                },
                {
                    field: 'applicantName',
                    title: '申请人名称'
                },
                {
                    field: 'applicantPhone',
                    title: '申请人手机'
                },
                {
                    field: 'applicantEmail',
                    title: '申请人邮箱'
                },
                {
                    field: 'reviewStatus',
                    title: '开店状态',
                    sortable:true,
                    formatter: function (value, item, index) {
                        return $.table.selectDictLabel(reviewStatusDict, value);
                    }
                },
                {
                    field: 'createTime',
                    title: '创建时间',
                    sortable:true
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function (value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.editTab(\'' + row.id + '\')"><i class="fa fa-edit">编辑</i></a> ');
                        return actions.join('');
                    }
                }]
        };
        $.table.init(options);
    });
</script>
</body>
</html>